@echo off

REM SHA1 sums of files required
REM 9988723269367fb44ef83f627186a1c88cf7877e decoder.4
REM 30002643d08ed983a6701a7c4b5ee74a2f4a1adb decoder.6
REM 0443e00ae2eb3e66cf805562ee04309487bb0ba4 3006-13.1b
REM 5fda266d43cbbf42eeae1a078b5209d9408ab99f 3006-14.2b
REM 686da120aa4bd4a41f3d93e8c79ebb343977851a 3006-15.3b
REM cb1c3285344e2cfbe0a81ab9b51758c40da8a23f 3006-16.4b
REM d9cac4c46820e1a451a145864bca7a35cfab7d37 3006-17.5b
REM febaa8cf5c3a0af901cd12d0b7909f6fec3beadd 3006-18.6b
REM 5ad14aa65e71c3856dcdb04c99edda92e406a3e3 3006-19.7b
REM f4ee13d5a95ed3e1050a3927a3a0ccf86ed7752d 3006-20.8b
REM d95d3b746133eac9dcc9ee05eabecb797023f1a5 3006-21.9b
REM 90864a8ab944df45287bf0f68ad3a85194077a82 3006-22.10b
REM 6d38003d56bebeb1f5b4d2287d587342847aa195 3006-23.11b
REM 7d01764e8251c60b3cab96f7dc6dcc1c624f9d12 3006-24.12b
REM af7c066d2949d36b87ea8c425ca7d12f82b5c653 joust.snd

set rom_path_src=..\roms\joust
set rom_path_dst=..\build
set romgen_path=..\tools

mkdir %rom_path_dst%
REM generate RAMB structures for larger ROMS

REM soundcpu
%romgen_path%\romgen %rom_path_src%\joust.snd    SND_ROM_0F    12 l r e > %rom_path_dst%\SND_ROM_0F.vhd

REM decoders
%romgen_path%\romgen %rom_path_src%\decoder.4    DECODER_4      9 a     > %rom_path_dst%\DEC_4.vhd
%romgen_path%\romgen %rom_path_src%\decoder.6    DECODER_6      9 a     > %rom_path_dst%\DEC_6.vhd

REM maincpu
%romgen_path%\romgen %rom_path_src%\3006-22.10b  CPU_ROM_0D    12 l r e > %rom_path_dst%\CPU_ROM_0D.vhd
%romgen_path%\romgen %rom_path_src%\3006-23.11b  CPU_ROM_0E    12 l r e > %rom_path_dst%\CPU_ROM_0E.vhd
%romgen_path%\romgen %rom_path_src%\3006-24.12b  CPU_ROM_0F    12 l r e > %rom_path_dst%\CPU_ROM_0F.vhd
%romgen_path%\romgen %rom_path_src%\3006-13.1b   CPU_ROM_10    12 l r e > %rom_path_dst%\CPU_ROM_10.vhd
%romgen_path%\romgen %rom_path_src%\3006-14.2b   CPU_ROM_11    12 l r e > %rom_path_dst%\CPU_ROM_11.vhd
%romgen_path%\romgen %rom_path_src%\3006-15.3b   CPU_ROM_12    12 l r e > %rom_path_dst%\CPU_ROM_12.vhd
%romgen_path%\romgen %rom_path_src%\3006-16.4b   CPU_ROM_13    12 l r e > %rom_path_dst%\CPU_ROM_13.vhd
%romgen_path%\romgen %rom_path_src%\3006-17.5b   CPU_ROM_14    12 l r e > %rom_path_dst%\CPU_ROM_14.vhd
%romgen_path%\romgen %rom_path_src%\3006-18.6b   CPU_ROM_15    12 l r e > %rom_path_dst%\CPU_ROM_15.vhd
%romgen_path%\romgen %rom_path_src%\3006-19.7b   CPU_ROM_16    12 l r e > %rom_path_dst%\CPU_ROM_16.vhd
%romgen_path%\romgen %rom_path_src%\3006-20.8b   CPU_ROM_17    12 l r e > %rom_path_dst%\CPU_ROM_17.vhd
%romgen_path%\romgen %rom_path_src%\3006-21.9b   CPU_ROM_18    12 l r e > %rom_path_dst%\CPU_ROM_18.vhd

echo done
pause
